const express = require('express')
const router = express.Router()

// 解决跨域问题
router.all("*", (req, res, next) => {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "*");
  res.header("Access-Control-Allow-Methods", "*");
  res.header("Content-Type", "application/json");
  next();
})

//引入路由模块
const userRouter = require('./userRoutes')
const classRouter = require('./classRoutes')
const SCLtestRouter = require('./SCLtestRoutes')

router.use("/api/user",userRouter)
router.use("/api/class",classRouter)
router.use("/api/SCLtest",SCLtestRouter)

module.exports = router